package org.xb;

/**
 * @Author
 * @Description 饿汉式
 * @Date created in 10:05 2024/10/22
 */
public class Main01 {
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            new Thread(()->{
                Person instance = Person.getInstance();
                System.out.println(instance.hashCode());
            }).start();
        }
    }
}
class Person {
    private Person() {
    }
    private static final Person person = new Person();
    public static Person getInstance() {
        return person;
    }
}


